package org.example.aicloud.mapper;


import org.apache.ibatis.annotations.Select;
import org.example.aicloud.entity.Comment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.example.aicloud.entity.vo.CommentVO;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2024-09-05
 */

public interface CommentMapper extends BaseMapper<Comment> {

    @Select("SELECT c.*,u.username FROM `comment` c LEFT JOIN `user` u ON c.uid = u.uid WHERE c.did = #{did} order by c.cid desc")
    List<CommentVO> getCommentList(@RequestParam("did") Long did);
}
